package y_2025.m04.d18.t02;

public class HardWork {
    public static void main(String[] args) {
        Employee[] e = new Employee[3];
        e[0] = new YearWorker();
        e[1] = new MonthWorker();
        e[2] = new WeekWorker();

        for (int i = 0; i < e.length; i++) {
            System.out.println("e[" + i + "].earnings() = " + e[i].earnings());
        }

    }
}